package controller
{
	import Model.Event.SelectTopicEvent;
	import Model.Topics;
	
	import flash.events.Event;

	public class TopicsController
	{
		public function TopicsController()
		{
		}
		
		public function selectTopic(event:SelectTopicEvent):void
		{
			var topicId:int = event.selectedTopicId;
			var topicIndex:int = Model.Topics.instance.getIndex(topicId);
			
			if(topicIndex != -1)
			{
				Model.Topics.instance.currentIndex = topicIndex;
				Model.Topics.instance.selectOneTopic(topicIndex);
			}
		}
	}
}